# _*_ coding:utf-8 _*_
# @File  : main.py
# @Time  : 2020-08-31 8:21
# @Author: zizle

import os
from fastapi.responses import FileResponse
from app import app
from configs import FILE_STORAGE


@app.get("/", tags=["主页"])
async def index():
    home_page = os.path.join(FILE_STORAGE, "home_page.html")
    return FileResponse(home_page)


@app.get("/favicon.ico", tags=["主页"])
async def favicon():
    favicon_path = os.path.join(FILE_STORAGE, "favicon.ico")
    return FileResponse(favicon_path, filename="favicon.ico")


if __name__ == '__main__':
    # 2022/02/07 这个项目已经不是一般的难维护了。重复的表，冲突的代码，炸了！炸了！！
    # 2022/05/26 一般只维护v1_all_api,其他的得保留,很多api还在使用
    import uvicorn
    uvicorn.run(app, host="127.0.0.1", port=8000)
